package com.woniuxy.mapper;

import com.work.framework.pojo.Balance;
import com.work.framework.pojo.BalanceHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

/**
 * @author Administrator
 * @title: BalanceHistoryMapper
 * @projectName mashangpai
 * @description: TODO
 * @date 2019/9/2810:04
 */
@Mapper
@Repository
public interface BalanceHistoryMapper {

    @Insert("INSERT INTO balance_history(uid,money,bhTime,bhState) VALUES(#{uid},#{money},#{bhTime},#{bhState})")
    void add(BalanceHistory balanceHistory);

    @Update("update balance set amount = #{money} where id =#{id}")
    Integer updateMoney(Integer id, BigDecimal money);
    @Select("select * from balance where uid =#{uid}")
    Balance findBalance(Integer uid);
}
